package com.example.bijiabao.servicesImpl;

import com.example.bijiabao.entity.collect;
import com.example.bijiabao.entity.collectView;
import com.example.bijiabao.mapper.CollectionMapper;
import com.example.bijiabao.services.CollectionServices;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollectionServicesImpl implements CollectionServices {

    @Autowired
    private CollectionMapper collectionMapper;

    //添加收藏
    @Override
    public Integer insertcollect(collect collect) {
        return collectionMapper.insertcollect(collect);
    }

    //删除收藏信息
    @Override
    public Integer DelLikeByID(Integer collectId) {
        return collectionMapper.DelLikeByID(collectId);
    }

    //查询用户自己的收藏
    @Override
    public List<collectView> SelectLikeByUserID(Integer userId) {
        return collectionMapper.SelectLikeByUserID(userId);
    }
}
